package group2.service.impl;

import group2.mapper.ReceiveAddressMapper;
import group2.model.ReceiveAddress;
import group2.service.IReceiveAddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 薛献军
 * @date 2020/8/25 19:32
 */
@Service("ReceiveAddressService")
public class ReceiveAddressServiceImpl implements IReceiveAddressService {

    @Autowired
    ReceiveAddressMapper receiveAddressMapper;

    @Override
    public int selectDefault(String userId) {
        return this.receiveAddressMapper.selectDefault(userId);
    }

    @Override
    public ReceiveAddress selectById(String userId) {
        return this.receiveAddressMapper.selectById(userId);
    }

    @Override
    public void addAddressYes(ReceiveAddress receiveAddress,  String userId) {
            this.receiveAddressMapper.addAddressYes(receiveAddress,userId);
    }

    @Override
    public void addAddressNo(ReceiveAddress receiveAddress,  String userId) {
            this.receiveAddressMapper.addAddressNo(receiveAddress,userId);
    }

    @Override
    public void updateAddressYes(int addressId,String userId) {
        this.receiveAddressMapper.updateAddressYes(addressId,userId);
    }

    @Override
    public void updateAddressNo(int addressId) {
        this.receiveAddressMapper.updateAddressNo(addressId);
    }

    @Override
    public List<ReceiveAddress> selectAllAddress( String userId) {
        return this.receiveAddressMapper.selectAllAddress(userId);
    }

    @Override
    public void delectAddress(int addressId) {
        this.receiveAddressMapper.delectAddress(addressId);
    }

    @Override
    public void updateAddress(ReceiveAddress receiveAddress) {

    }
}
